#include <climits>
#include <cstdint>
#include <vector>
using namespace std;

class Solution {
    using ll = int64_t;
public:
    static inline ll lowbit(ll n){
        return n&(-n);
    }
    constexpr vector<int> productQueries(int n, vector<vector<int>>& queries) {
        const ll M=1e9+7;
        vector<ll> v;
        v.reserve(128);
        while(lowbit(n)){
            v.push_back(lowbit(n));
            n-=lowbit(n);
        }
        vector<int> ans;
        ans.reserve(queries.size());
        for(ll i=0;i<queries.size();i++){
            ll nans=1;
            for(ll j=queries[i][0];j<=queries[i][1];j++){
                nans=nans*v[j]%M;
            }
            ans.push_back(nans);
        }
        return ans;
    }
};

int main(){

}